package com.hilin.etcd.discovery;

import com.hilin.etcd.discovery.config.HilinEtcdDiscoveryConfig;
import com.hilin.etcd.discovery.handler.HilinEtcdRegisterHandler;
import mousio.etcd4j.EtcdClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@EnableConfigurationProperties({
        HilinEtcdDiscoveryConfig.class
})
public class HilinEtcdDiscoveryAutoConfig {

    @Bean
    public HilinEtcdRegisterHandler hilinEtcdRegisterHandler(HilinEtcdDiscoveryConfig etcdDiscoveryConfig, EtcdClient etcdClient) {
        return new HilinEtcdRegisterHandler(etcdDiscoveryConfig, etcdClient);
    }

}
